<!--产能分析-->
<table class="layui-table mt30">
	<thead>
		<tr class="layui-bg-blue">
			<th width="20%">7日平均日产能</th>
			<th width="20%">14日平均日产能</th>
			<th width="20%">21日平均日产能</th>
			<th width="20%">在途产能</th>
			<th width="20%">压力系数</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><span id="recently7_jianshu">0</span>件<br><span id="recently7_money">0</span>元</td>
			<td><span id="recently14_jianshu">0</span>件<br><span id="recently14_money">0</span>元</td>
			<td><span id="recently21_jianshu">0</span>件<br><span id="recently21_money">0</span>元</td>
			<td><a href="javascript:showDetail('在途产能-订单列表', '{:url('', '_ajax=1&fun=_getCnfx&detail=1&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')" style="text-decoration:underline"><span id="recentlyIng_jianshu">0</span>件/<span id="recentlyIng_orders">0</span>单<br><span id="recentlyIng_money">0</span>元</a></td>
			<td><span id="pressureRate_jianshu">0</span><br><span id="pressureRate_money">0</span></td>
		</tr>
	</tbody>
</table>

<script>
layui.use(['jquery', 'layer'], function() {
	var $ = layui.jquery;
	var layer = layui.layer;
	
	//产能分析
	window.getCnfx = function() {
		$.ajax({
			type: "POST",
			url: "?c=daily&m=index",
			data: "_ajax=1&fun=_getCnfx&factory_id="+factoryId+"&from="+from,
			dataType: "json",
			success: function(res){
				if(res.code == 1){
					var d = res.data;
					$("#recently7_jianshu").html(d.recently7.jianshu);
					$("#recently7_money").html(d.recently7.money);
					$("#recently14_jianshu").html(d.recently14.jianshu);
					$("#recently14_money").html(d.recently14.money);
					$("#recently21_jianshu").html(d.recently21.jianshu);
					$("#recently21_money").html(d.recently21.money);
					$("#recentlyIng_jianshu").html(d.recentlyIng.jianshu);
					$("#recentlyIng_orders").html(d.recentlyIng.orders);
					$("#recentlyIng_money").html(d.recentlyIng.money);
					$("#pressureRate_jianshu").html(d.pressureRate.jianshu);
					$("#pressureRate_money").html(d.pressureRate.money);
				}else layer.msg(res.msg, {icon: 2,anim: 6});
			}
		});
	}
	
	getCnfx(); 	// 产能分析
	setInterval("getCnfx()", 1200000); 	// 20分钟
});
</script>